package fy.config;

import org.apache.commons.logging.LogFactory;

import com.seeyon.ctp.util.json.JSONUtil;

public final class FyConfig {

	private static DBConfigBean OA_DB_CONFIG;
	private static DBConfigBean EHR_DB_CONFIG;
	private static DBConfigBean ERP_DB_CONFIG;
	private static DBConfigBean UAP_DB_CONFIG;

	public static void setOA_DB_CONFIG(String user, String password,
			String url, String dblink, String driverClassName) {
		OA_DB_CONFIG = new DBConfigBean(url, user, password, dblink,
				driverClassName);
		LogFactory.getLog(FyConfig.class).info(JSONUtil.toJSONString(OA_DB_CONFIG));
	}

	public static void setEHR_DB_CONFIG(String user, String password,
			String url, String dblink, String driverClassName) {
		EHR_DB_CONFIG = new DBConfigBean(url, user, password, dblink,
				driverClassName);
		LogFactory.getLog(FyConfig.class).info(JSONUtil.toJSONString(EHR_DB_CONFIG));
	}

	public static void setERP_DB_CONFIG(String user, String password,
			String url, String dblink, String driverClassName) {
		ERP_DB_CONFIG = new DBConfigBean(url, user, password, dblink,
				driverClassName);
		LogFactory.getLog(FyConfig.class).info(JSONUtil.toJSONString(ERP_DB_CONFIG));
	}

	public static void setUAP_DB_CONFIG(String user, String password,
			String url, String dblink, String driverClassName) {
		UAP_DB_CONFIG = new DBConfigBean(url, user, password, dblink,
				driverClassName);
		LogFactory.getLog(FyConfig.class).info(JSONUtil.toJSONString(UAP_DB_CONFIG));
	}

	public static DBConfigBean getOA_DB_CONFIG() {
		return OA_DB_CONFIG;
	}

	public static DBConfigBean getEHR_DB_CONFIG() {
		return EHR_DB_CONFIG;
	}

	public static DBConfigBean getERP_DB_CONFIG() {
		return ERP_DB_CONFIG;
	}

	public static DBConfigBean getUAP_DB_CONFIG() {
		return UAP_DB_CONFIG;
	}
}
